//
//  CYGDetailRcmdTextCell.m
//  CYGHuntForCity
//
//  Created by cygarm on 16/3/26.
//  Copyright © 2016年 cygarm. All rights reserved.
//

#import "CYGDetailRcmdTextCell.h"

@interface CYGDetailRcmdTextCell ()

@property (weak, nonatomic) IBOutlet UILabel *rcmdTextLabel;


@end

@implementation CYGDetailRcmdTextCell

- (void)awakeFromNib {
    // Initialization code
	self.selectionStyle = UITableViewCellSelectionStyleNone;
	self.rcmdTextLabel.preferredMaxLayoutWidth = CYGAppWidth-30;
}

+ (instancetype)cellWithTableView:(UITableView *)tableView model:(CYGDetailRcmdCellModel *)model {
	static NSString *cellID = @"idDetailRcmdTextCell";
	CYGDetailRcmdTextCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
	if (cell == nil) {
		cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
	}
	cell.model = model;
	return cell;
}

- (void)setModel:(CYGDetailRcmdCellModel *)model {
	_model = model;
	self.rcmdTextLabel.text = model.ch;
	[self layoutIfNeeded];
	model.cellHeight = CGRectGetMaxY(self.rcmdTextLabel.frame)+10;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
